import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 回收型号信息 */
export interface Model {
          modelName?: string; // 型号名称
          brandId?: number; // 所属品牌ID
          categoryId?: number; // 所属品类ID
          modelParams: string; // 型号参数(如:内存、存储等)
          status: number; // 状态
          sort: number; // 排序值
  }

// 回收型号 API
export const ModelApi = {
  // 查询回收型号分页
  getModelPage: async (params: any) => {
    return await request.get({ url: `/recycling/model/page`, params })
  },

  // 查询回收型号详情
  getModel: async (id: number) => {
    return await request.get({ url: `/recycling/model/get?id=` + id })
  },

  // 新增回收型号
  createModel: async (data: Model) => {
    return await request.post({ url: `/recycling/model/create`, data })
  },

  // 修改回收型号
  updateModel: async (data: Model) => {
    return await request.put({ url: `/recycling/model/update`, data })
  },

  // 删除回收型号
  deleteModel: async (id: number) => {
    return await request.delete({ url: `/recycling/model/delete?id=` + id })
  },

  /** 批量删除回收型号 */
  deleteModelList: async (ids: number[]) => {
    return await request.delete({ url: `/recycling/model/delete-list?ids=${ids.join(',')}` })
  },

  // 导出回收型号 Excel
  exportModel: async (params) => {
    return await request.download({ url: `/recycling/model/export-excel`, params })
  },
}